<?php

error_reporting(E_ALL);

/**
 * untitledModel - class.Conexion.php
 *
 * $Id$
 *
 * This file is part of untitledModel.
 *
 * Automatically generated on 27.11.2011, 19:02:44 with ArgoUML PHP module 
 * (last revised $Date: 2010-01-12 20:14:42 +0100 (Tue, 12 Jan 2010) $)
 *
 * @author firstname and lastname of author, <author@example.org>
 */

if (0 > version_compare(PHP_VERSION, '5')) {
    die('This file was generated for PHP 5');
}

/* user defined includes */
// section 10-0-101-116-75074dcc:133e14e2698:-8000:000000000000178C-includes begin
// section 10-0-101-116-75074dcc:133e14e2698:-8000:000000000000178C-includes end

/* user defined constants */
// section 10-0-101-116-75074dcc:133e14e2698:-8000:000000000000178C-constants begin
// section 10-0-101-116-75074dcc:133e14e2698:-8000:000000000000178C-constants end

/**
 * Short description of class Conexion
 *
 * @access public
 * @author firstname and lastname of author, <author@example.org>
 */
class Conexion
{
    // --- ASSOCIATIONS ---


    // --- ATTRIBUTES ---

    /**
     * Short description of attribute host
     *
     * @access public
     * @var String
     */
    public $host = "mysql.juliorr.com";
	

    /**
     * Short description of attribute user
     *
     * @access public
     * @var String
     */
    public $user = "lily_22_315";

    /**
     * Short description of attribute pass
     *
     * @access public
     * @var String
     */
    public $pass = "AK,d9.";

    /**
     * Short description of attribute cont
     *
     * @access public
     * @var String
     */
    public $cont = null;

    // --- OPERATIONS ---

    /**
     * Short description of method Conxion
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @return mixed
     */
    public function Conexion()
    {
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017D2 begin
		
		$this->cont = mysql_connect($this->host,$this->user,$this->pass);
		mysql_select_db("proyecto_uth", $this->cont);
		if (!$this->cont){
			die('No se pudo conectar al servidor: ' . mysql_error());
		}
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017D2 end
    }

    /**
     * Short description of method EjecutarQuery
     *
     * @access public
     * @author firstname and lastname of author, <author@example.org>
     * @param  sql
     * @return mixed
     */
    public function EjecutarQuery($sql)
    {
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017D4 begin
		 $arr = null;
		$res =  mysql_query($sql); 
		if (!$res) {
			die('Cadena Invalida: ['.$sql.']'. mysql_error());							
		}	
	    while ($row = @mysql_fetch_assoc($res)) {
			$arr[]=$row;
		}
		return $arr;
        // section 10-0-101-116-75074dcc:133e14e2698:-8000:00000000000017D4 end
    }

} /* end of class Conexion */

?>